feat: configurable reference frame for a north-referenced azimuth#96
feat: configurable reference frame for a north-referenced azimuth#96camilleRiquet wants to merge 69 commits into
Conversation
Bumps [simple_3d_renderer](https://github.com/MasahideMori-SimpleAppli/simple_3d_renderer) from 19.1.0 to 20.0.2. - [Changelog](https://github.com/MasahideMori-SimpleAppli/simple_3d_renderer/blob/main/CHANGELOG.md) - [Commits](https://github.com/MasahideMori-SimpleAppli/simple_3d_renderer/commits) --- updated-dependencies: - dependency-name: simple_3d_renderer dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.jetbrains.kotlin.android](https://github.com/JetBrains/kotlin) from 2.0.0 to 2.0.20. - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](JetBrains/kotlin@v2.0.0...v2.0.20) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin.android dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps com.android.application from 8.5.1 to 8.6.0. --- updated-dependencies: - dependency-name: com.android.application dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.jetbrains.kotlin:kotlin-gradle-plugin](https://github.com/JetBrains/kotlin) from 2.0.0 to 2.0.20. - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](JetBrains/kotlin@v2.0.0...v2.0.20) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps com.android.tools.build:gradle from 8.5.1 to 8.6.0. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.12.0 to 5.13.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](mockito/mockito@v5.12.0...v5.13.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [flutter_lints](https://github.com/flutter/packages/tree/main/packages) from 4.0.0 to 5.0.0. - [Release notes](https://github.com/flutter/packages/releases) - [Commits](https://github.com/flutter/packages/commits/flutter_lints-v5.0.0/packages) --- updated-dependencies: - dependency-name: flutter_lints dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [flutter_lints](https://github.com/flutter/packages/tree/main/packages) from 4.0.0 to 5.0.0. - [Release notes](https://github.com/flutter/packages/releases) - [Commits](https://github.com/flutter/packages/commits/flutter_lints-v5.0.0/packages) --- updated-dependencies: - dependency-name: flutter_lints dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps com.android.application from 8.6.0 to 8.6.1. --- updated-dependencies: - dependency-name: com.android.application dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps com.android.tools.build:gradle from 8.6.0 to 8.6.1. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.13.0 to 5.14.1. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](mockito/mockito@v5.13.0...v5.14.1) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps com.android.application from 8.6.1 to 8.7.2. --- updated-dependencies: - dependency-name: com.android.application dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.14.1 to 5.14.2. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](mockito/mockito@v5.14.1...v5.14.2) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps com.android.tools.build:gradle from 8.6.1 to 8.7.2. --- updated-dependencies: - dependency-name: com.android.tools.build:gradle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [simple_3d_renderer](https://github.com/MasahideMori-SimpleAppli/simple_3d_renderer) from 20.0.2 to 21.0.0. - [Changelog](https://github.com/MasahideMori-SimpleAppli/simple_3d_renderer/blob/main/CHANGELOG.md) - [Commits](https://github.com/MasahideMori-SimpleAppli/simple_3d_renderer/commits) --- updated-dependencies: - dependency-name: simple_3d_renderer dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.jetbrains.kotlin:kotlin-gradle-plugin](https://github.com/JetBrains/kotlin) from 2.0.20 to 2.1.0. - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v2.1.0/ChangeLog.md) - [Commits](JetBrains/kotlin@v2.0.20...v2.1.0) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.jetbrains.kotlin.android](https://github.com/JetBrains/kotlin) from 2.0.20 to 2.1.0. - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v2.1.0/ChangeLog.md) - [Commits](JetBrains/kotlin@v2.0.20...v2.1.0) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin.android dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.jetbrains.kotlin.android](https://github.com/JetBrains/kotlin) from 2.1.0 to 2.1.10. - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](JetBrains/kotlin@v2.1.0...v2.1.10) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin.android dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.jetbrains.kotlin:kotlin-gradle-plugin](https://github.com/JetBrains/kotlin) from 2.1.0 to 2.1.10. - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](JetBrains/kotlin@v2.1.0...v2.1.10) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.14.2 to 5.15.2. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](mockito/mockito@v5.14.2...v5.15.2) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [simple_3d_renderer](https://github.com/MasahideMori-SimpleAppli/simple_3d_renderer) from 21.0.0 to 22.0.0. - [Changelog](https://github.com/MasahideMori-SimpleAppli/simple_3d_renderer/blob/main/CHANGELOG.md) - [Commits](https://github.com/MasahideMori-SimpleAppli/simple_3d_renderer/commits) --- updated-dependencies: - dependency-name: simple_3d_renderer dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps com.android.application from 8.7.2 to 8.8.2. --- updated-dependencies: - dependency-name: com.android.application dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…mple/android Dependabot couldn't find the original pull request head commit, 92c135d.
…android Dependabot couldn't find the original pull request head commit, 2b82b36.
…/android Dependabot couldn't find the original pull request head commit, d3cac45.
Dependabot couldn't find the original pull request head commit, 85c5b23.
Displays whether the current platform (e.g., Android/iOS) supports rotation sensing.
fcf46cb to
96f7d42
Compare
|
Thanks for the PR @camilleRiquet ! 🙏 |
0fa2ff4 to
ee5011d
Compare
e03c655 to
da59679
Compare
|
I cannot merge this directly as it currently has conflicts and I don't have permission to edit your PR branch. Instead, I have cherry-picked your commits into the main branch and added your credit to the README. I will be closing this PR now. Also, version v0.3.0 has been published, so please feel free to take a look! |
Closes #95
Motivation
The azimuth is inconsistent across platforms:
Details and a reproduction are in #95.
What this PR does
Adds an opt-in RotationSensor.referenceFrame:
enum ReferenceFrame { device, magneticNorth, trueNorth }
RotationSensor.referenceFrame = ReferenceFrame.magneticNorth;
iOS
Maps the value to the matching CMAttitudeReferenceFrame. CoreMotion expresses a north frame as (north, west, up), whereas this package's documented world is (east, north, up). For north frames the attitude quaternion is rotated
90° about the vertical axis so the emitted orientation matches the package convention and the azimuth stays 0 == north, consistent with Android. The frame is re-applied (sensor restarted) when the value changes mid-stream.
Android
TYPE_ROTATION_VECTOR is already magnetic-north / east-north-up, so all values keep using it. True north would need the local geomagnetic declination (requires a location fix); until then trueNorth behaves like magneticNorth on
Android (documented in the enum).
Notes
Testing
Verified on a physical iOS device with magneticNorth: pointing north reads ~0°, east ~90°; the heading is stable under pitch/roll and only changes when rotating about the vertical axis; consistent across cold launches. Android
behavior unchanged.
Disclaimer
Sorry about the previous pull request; I meant to submit a pull request on my fork but made a mistake.
As mentioned in issue #95, I made this change to fix the issue that was discovered, but it might just be that I made a mistake in the initial configuration.